<template>
  <div v-if="withdrawAuth">
    <page-header :title="$t('m.Partner_withdrawal')" :has-return="false">
      <el-button
        type="primary"
        @click="$router.push('/finance/earnings')"
        v-if="earningsAuth && getUserType() == 2"
        >{{ $t('m.My_Revenue') }}</el-button
      >
    </page-header>
    <div class="container">
      <div class="box_index">
        <!--tab栏-->
        <div class="el_table_div" style="padding-bottom:0;">
          <el-tabs v-model="activeTab" @tab-click="switchTab">
            <el-tab-pane
              v-for="(item, index) in optionsTab"
              :key="index"
              :name="String(item.value)"
              :label="item.label"
            >
            </el-tab-pane>
          </el-tabs>
        </div>

        <!--提现审核-->
        <div class="card card2" v-if="activeTab == '1'">
          <withdraw-audit />
        </div>
        <div class="card card2" v-if="activeTab == '2'">
          <withdraw-record />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import WithdrawAudit from '@/components/tables/withdraw-audit.vue'
import WithdrawRecord from '@/components/tables/withdraw-record.vue'
export default {
  components: { WithdrawAudit, WithdrawRecord },

  data () {
    return {
      activeTab: '1',

      optionsTab: [
        {
          value: '1',
          label: this.$t('m.Withdrawal_review')
        },
        {
          value: '2',
          label: this.$t('m.withdrawRecord')
        }
      ],
      withdrawAuth: this.permissionsId(63),
      earningsAuth: this.permissionsId(217)
    }
  },

  created () {},
  methods: {
    // 切换tab
    switchTab () {
      this.remPageNum()
    }
  }
}
</script>
<style scoped lang="scss">
.card2 {
  border-radius: 10px !important;
  padding: 0 !important;
  border: none !important;
}
</style>
